/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.cmc.service.merchant.service.persistence;

import com.cmc.service.merchant.model.MerchantEntry;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.ServiceContext;

import java.util.List;

/**
 * The persistence utility for the merchant entry service. This utility wraps {@link MerchantEntryPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author ntcuong1
 * @see MerchantEntryPersistence
 * @see MerchantEntryPersistenceImpl
 * @generated
 */
public class MerchantEntryUtil {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
	 */

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
	 */
	public static void clearCache() {
		getPersistence().clearCache();
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
	 */
	public static void clearCache(MerchantEntry merchantEntry) {
		getPersistence().clearCache(merchantEntry);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
	 */
	public long countWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
	 */
	public static List<MerchantEntry> findWithDynamicQuery(
		DynamicQuery dynamicQuery) throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
	 */
	public static List<MerchantEntry> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end)
		throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
	 */
	public static List<MerchantEntry> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		return getPersistence()
				   .findWithDynamicQuery(dynamicQuery, start, end,
			orderByComparator);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
	 */
	public static MerchantEntry update(MerchantEntry merchantEntry,
		boolean merge) throws SystemException {
		return getPersistence().update(merchantEntry, merge);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
	 */
	public static MerchantEntry update(MerchantEntry merchantEntry,
		boolean merge, ServiceContext serviceContext) throws SystemException {
		return getPersistence().update(merchantEntry, merge, serviceContext);
	}

	/**
	* Caches the merchant entry in the entity cache if it is enabled.
	*
	* @param merchantEntry the merchant entry
	*/
	public static void cacheResult(
		com.cmc.service.merchant.model.MerchantEntry merchantEntry) {
		getPersistence().cacheResult(merchantEntry);
	}

	/**
	* Caches the merchant entries in the entity cache if it is enabled.
	*
	* @param merchantEntries the merchant entries
	*/
	public static void cacheResult(
		java.util.List<com.cmc.service.merchant.model.MerchantEntry> merchantEntries) {
		getPersistence().cacheResult(merchantEntries);
	}

	/**
	* Creates a new merchant entry with the primary key. Does not add the merchant entry to the database.
	*
	* @param merchantId the primary key for the new merchant entry
	* @return the new merchant entry
	*/
	public static com.cmc.service.merchant.model.MerchantEntry create(
		long merchantId) {
		return getPersistence().create(merchantId);
	}

	/**
	* Removes the merchant entry with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param merchantId the primary key of the merchant entry
	* @return the merchant entry that was removed
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a merchant entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry remove(
		long merchantId)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().remove(merchantId);
	}

	public static com.cmc.service.merchant.model.MerchantEntry updateImpl(
		com.cmc.service.merchant.model.MerchantEntry merchantEntry,
		boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().updateImpl(merchantEntry, merge);
	}

	/**
	* Returns the merchant entry with the primary key or throws a {@link com.cmc.service.merchant.NoSuchMerchantEntryException} if it could not be found.
	*
	* @param merchantId the primary key of the merchant entry
	* @return the merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a merchant entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry findByPrimaryKey(
		long merchantId)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByPrimaryKey(merchantId);
	}

	/**
	* Returns the merchant entry with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param merchantId the primary key of the merchant entry
	* @return the merchant entry, or <code>null</code> if a merchant entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByPrimaryKey(
		long merchantId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByPrimaryKey(merchantId);
	}

	/**
	* Returns all the merchant entries where companyId = &#63;.
	*
	* @param companyId the company ID
	* @return the matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findByCompany(
		long companyId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByCompany(companyId);
	}

	/**
	* Returns a range of all the merchant entries where companyId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param companyId the company ID
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @return the range of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findByCompany(
		long companyId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByCompany(companyId, start, end);
	}

	/**
	* Returns an ordered range of all the merchant entries where companyId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param companyId the company ID
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findByCompany(
		long companyId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByCompany(companyId, start, end, orderByComparator);
	}

	/**
	* Returns the first merchant entry in the ordered set where companyId = &#63;.
	*
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry findByCompany_First(
		long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByCompany_First(companyId, orderByComparator);
	}

	/**
	* Returns the first merchant entry in the ordered set where companyId = &#63;.
	*
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByCompany_First(
		long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByCompany_First(companyId, orderByComparator);
	}

	/**
	* Returns the last merchant entry in the ordered set where companyId = &#63;.
	*
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry findByCompany_Last(
		long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByCompany_Last(companyId, orderByComparator);
	}

	/**
	* Returns the last merchant entry in the ordered set where companyId = &#63;.
	*
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByCompany_Last(
		long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByCompany_Last(companyId, orderByComparator);
	}

	/**
	* Returns the merchant entries before and after the current merchant entry in the ordered set where companyId = &#63;.
	*
	* @param merchantId the primary key of the current merchant entry
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a merchant entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry[] findByCompany_PrevAndNext(
		long merchantId, long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByCompany_PrevAndNext(merchantId, companyId,
			orderByComparator);
	}

	/**
	* Returns the merchant entry where code = &#63; or throws a {@link com.cmc.service.merchant.NoSuchMerchantEntryException} if it could not be found.
	*
	* @param code the code
	* @return the matching merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry findByCode(
		java.lang.String code)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByCode(code);
	}

	/**
	* Returns the merchant entry where code = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param code the code
	* @return the matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByCode(
		java.lang.String code)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByCode(code);
	}

	/**
	* Returns the merchant entry where code = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param code the code
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByCode(
		java.lang.String code, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByCode(code, retrieveFromCache);
	}

	/**
	* Returns the merchant entry where parentId = &#63; or throws a {@link com.cmc.service.merchant.NoSuchMerchantEntryException} if it could not be found.
	*
	* @param parentId the parent ID
	* @return the matching merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry findByParent(
		long parentId)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByParent(parentId);
	}

	/**
	* Returns the merchant entry where parentId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param parentId the parent ID
	* @return the matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByParent(
		long parentId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByParent(parentId);
	}

	/**
	* Returns the merchant entry where parentId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param parentId the parent ID
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByParent(
		long parentId, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByParent(parentId, retrieveFromCache);
	}

	/**
	* Returns all the merchant entries where type = &#63;.
	*
	* @param type the type
	* @return the matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findByType(
		java.lang.String type)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByType(type);
	}

	/**
	* Returns a range of all the merchant entries where type = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param type the type
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @return the range of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findByType(
		java.lang.String type, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByType(type, start, end);
	}

	/**
	* Returns an ordered range of all the merchant entries where type = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param type the type
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findByType(
		java.lang.String type, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByType(type, start, end, orderByComparator);
	}

	/**
	* Returns the first merchant entry in the ordered set where type = &#63;.
	*
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry findByType_First(
		java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByType_First(type, orderByComparator);
	}

	/**
	* Returns the first merchant entry in the ordered set where type = &#63;.
	*
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByType_First(
		java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByType_First(type, orderByComparator);
	}

	/**
	* Returns the last merchant entry in the ordered set where type = &#63;.
	*
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry findByType_Last(
		java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByType_Last(type, orderByComparator);
	}

	/**
	* Returns the last merchant entry in the ordered set where type = &#63;.
	*
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByType_Last(
		java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByType_Last(type, orderByComparator);
	}

	/**
	* Returns the merchant entries before and after the current merchant entry in the ordered set where type = &#63;.
	*
	* @param merchantId the primary key of the current merchant entry
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a merchant entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry[] findByType_PrevAndNext(
		long merchantId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByType_PrevAndNext(merchantId, type, orderByComparator);
	}

	/**
	* Returns all the merchant entries where parentId = &#63; and type = &#63;.
	*
	* @param parentId the parent ID
	* @param type the type
	* @return the matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findByParentAndMerchantType(
		long parentId, java.lang.String type)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByParentAndMerchantType(parentId, type);
	}

	/**
	* Returns a range of all the merchant entries where parentId = &#63; and type = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param parentId the parent ID
	* @param type the type
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @return the range of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findByParentAndMerchantType(
		long parentId, java.lang.String type, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByParentAndMerchantType(parentId, type, start, end);
	}

	/**
	* Returns an ordered range of all the merchant entries where parentId = &#63; and type = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param parentId the parent ID
	* @param type the type
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findByParentAndMerchantType(
		long parentId, java.lang.String type, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByParentAndMerchantType(parentId, type, start, end,
			orderByComparator);
	}

	/**
	* Returns the first merchant entry in the ordered set where parentId = &#63; and type = &#63;.
	*
	* @param parentId the parent ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry findByParentAndMerchantType_First(
		long parentId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByParentAndMerchantType_First(parentId, type,
			orderByComparator);
	}

	/**
	* Returns the first merchant entry in the ordered set where parentId = &#63; and type = &#63;.
	*
	* @param parentId the parent ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByParentAndMerchantType_First(
		long parentId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByParentAndMerchantType_First(parentId, type,
			orderByComparator);
	}

	/**
	* Returns the last merchant entry in the ordered set where parentId = &#63; and type = &#63;.
	*
	* @param parentId the parent ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry findByParentAndMerchantType_Last(
		long parentId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByParentAndMerchantType_Last(parentId, type,
			orderByComparator);
	}

	/**
	* Returns the last merchant entry in the ordered set where parentId = &#63; and type = &#63;.
	*
	* @param parentId the parent ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching merchant entry, or <code>null</code> if a matching merchant entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry fetchByParentAndMerchantType_Last(
		long parentId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByParentAndMerchantType_Last(parentId, type,
			orderByComparator);
	}

	/**
	* Returns the merchant entries before and after the current merchant entry in the ordered set where parentId = &#63; and type = &#63;.
	*
	* @param merchantId the primary key of the current merchant entry
	* @param parentId the parent ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next merchant entry
	* @throws com.cmc.service.merchant.NoSuchMerchantEntryException if a merchant entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry[] findByParentAndMerchantType_PrevAndNext(
		long merchantId, long parentId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByParentAndMerchantType_PrevAndNext(merchantId,
			parentId, type, orderByComparator);
	}

	/**
	* Returns all the merchant entries.
	*
	* @return the merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll();
	}

	/**
	* Returns a range of all the merchant entries.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @return the range of merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end);
	}

	/**
	* Returns an ordered range of all the merchant entries.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.MerchantEntry> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end, orderByComparator);
	}

	/**
	* Removes all the merchant entries where companyId = &#63; from the database.
	*
	* @param companyId the company ID
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByCompany(long companyId)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByCompany(companyId);
	}

	/**
	* Removes the merchant entry where code = &#63; from the database.
	*
	* @param code the code
	* @return the merchant entry that was removed
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry removeByCode(
		java.lang.String code)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().removeByCode(code);
	}

	/**
	* Removes the merchant entry where parentId = &#63; from the database.
	*
	* @param parentId the parent ID
	* @return the merchant entry that was removed
	* @throws SystemException if a system exception occurred
	*/
	public static com.cmc.service.merchant.model.MerchantEntry removeByParent(
		long parentId)
		throws com.cmc.service.merchant.NoSuchMerchantEntryException,
			com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().removeByParent(parentId);
	}

	/**
	* Removes all the merchant entries where type = &#63; from the database.
	*
	* @param type the type
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByType(java.lang.String type)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByType(type);
	}

	/**
	* Removes all the merchant entries where parentId = &#63; and type = &#63; from the database.
	*
	* @param parentId the parent ID
	* @param type the type
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByParentAndMerchantType(long parentId,
		java.lang.String type)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByParentAndMerchantType(parentId, type);
	}

	/**
	* Removes all the merchant entries from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public static void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeAll();
	}

	/**
	* Returns the number of merchant entries where companyId = &#63;.
	*
	* @param companyId the company ID
	* @return the number of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static int countByCompany(long companyId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByCompany(companyId);
	}

	/**
	* Returns the number of merchant entries where code = &#63;.
	*
	* @param code the code
	* @return the number of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static int countByCode(java.lang.String code)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByCode(code);
	}

	/**
	* Returns the number of merchant entries where parentId = &#63;.
	*
	* @param parentId the parent ID
	* @return the number of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static int countByParent(long parentId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByParent(parentId);
	}

	/**
	* Returns the number of merchant entries where type = &#63;.
	*
	* @param type the type
	* @return the number of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static int countByType(java.lang.String type)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByType(type);
	}

	/**
	* Returns the number of merchant entries where parentId = &#63; and type = &#63;.
	*
	* @param parentId the parent ID
	* @param type the type
	* @return the number of matching merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static int countByParentAndMerchantType(long parentId,
		java.lang.String type)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByParentAndMerchantType(parentId, type);
	}

	/**
	* Returns the number of merchant entries.
	*
	* @return the number of merchant entries
	* @throws SystemException if a system exception occurred
	*/
	public static int countAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countAll();
	}

	/**
	* Returns all the agent entries associated with the merchant entry.
	*
	* @param pk the primary key of the merchant entry
	* @return the agent entries associated with the merchant entry
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.AgentEntry> getAgentEntries(
		long pk) throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().getAgentEntries(pk);
	}

	/**
	* Returns a range of all the agent entries associated with the merchant entry.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param pk the primary key of the merchant entry
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @return the range of agent entries associated with the merchant entry
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.AgentEntry> getAgentEntries(
		long pk, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().getAgentEntries(pk, start, end);
	}

	/**
	* Returns an ordered range of all the agent entries associated with the merchant entry.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param pk the primary key of the merchant entry
	* @param start the lower bound of the range of merchant entries
	* @param end the upper bound of the range of merchant entries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of agent entries associated with the merchant entry
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.cmc.service.merchant.model.AgentEntry> getAgentEntries(
		long pk, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .getAgentEntries(pk, start, end, orderByComparator);
	}

	/**
	* Returns the number of agent entries associated with the merchant entry.
	*
	* @param pk the primary key of the merchant entry
	* @return the number of agent entries associated with the merchant entry
	* @throws SystemException if a system exception occurred
	*/
	public static int getAgentEntriesSize(long pk)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().getAgentEntriesSize(pk);
	}

	/**
	* Returns <code>true</code> if the agent entry is associated with the merchant entry.
	*
	* @param pk the primary key of the merchant entry
	* @param agentEntryPK the primary key of the agent entry
	* @return <code>true</code> if the agent entry is associated with the merchant entry; <code>false</code> otherwise
	* @throws SystemException if a system exception occurred
	*/
	public static boolean containsAgentEntry(long pk, long agentEntryPK)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().containsAgentEntry(pk, agentEntryPK);
	}

	/**
	* Returns <code>true</code> if the merchant entry has any agent entries associated with it.
	*
	* @param pk the primary key of the merchant entry to check for associations with agent entries
	* @return <code>true</code> if the merchant entry has any agent entries associated with it; <code>false</code> otherwise
	* @throws SystemException if a system exception occurred
	*/
	public static boolean containsAgentEntries(long pk)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().containsAgentEntries(pk);
	}

	public static MerchantEntryPersistence getPersistence() {
		if (_persistence == null) {
			_persistence = (MerchantEntryPersistence)PortletBeanLocatorUtil.locate(com.cmc.service.merchant.service.ClpSerializer.getServletContextName(),
					MerchantEntryPersistence.class.getName());

			ReferenceRegistry.registerReference(MerchantEntryUtil.class,
				"_persistence");
		}

		return _persistence;
	}

	/**
	 * @deprecated
	 */
	public void setPersistence(MerchantEntryPersistence persistence) {
	}

	private static MerchantEntryPersistence _persistence;
}